﻿<Application x:Class="FeedNews.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:views="clr-namespace:FeedNews.Views"
             xmlns:vm="clr-namespace:FeedNews.ViewModels"
             StartupUri="MainWindow.xaml">
    <Application.Resources>
        <vm:MainViewModelLocator x:Key="MainViewLocator" />
        <vm:RSSFeedModelLocator x:Key="RSSFeddViewLocator"/>

        <DataTemplate DataType="{x:Type vm:FeedNewsViewModel}">
            <views:FeedNewsView/>
        </DataTemplate>
        <DataTemplate DataType="{x:Type vm:FeedNewsBoardViewModel}">
            <views:FeedNewsBoardView/>
        </DataTemplate>
        <DataTemplate DataType="{x:Type vm:FeedNewsHtmlViewModel}">
            <views:FeedNewsHtmlView/>
        </DataTemplate>
        <DataTemplate DataType="{x:Type vm:SettingViewModel}">
            <views:SettingView/>
        </DataTemplate>
        <DataTemplate DataType="{x:Type vm:SearchRSSViewModel}">
            <views:SearchRSSView/>
        </DataTemplate>
        <!-- Button Style -->
        <Style x:Key="MainViewButtonStyle" TargetType="{x:Type Button}">
            <Setter Property="Height" Value="52" />
            <Setter Property="Width" Value="136" />
            <Setter Property="HorizontalAlignment" Value="Left" />
            <Setter Property="VerticalAlignment" Value="Top" />
        </Style>

        <Style x:Key="RSSFeedBoardViewButtonStyle" TargetType="{x:Type Button}">
            <Setter Property="Width" Value="Auto" />
            <Setter Property="Height" Value="Auto" />
            <Setter Property="Margin" Value="5" />
            <Setter Property="VerticalAlignment" Value="Center" />
            <Setter Property="Focusable" Value="False"/>
            <Setter Property="Opacity"  Value="0.2"/>
            <Setter Property="BorderThickness" Value="0"/>
            <Setter Property="BorderBrush" Value="Transparent" />
            <Setter Property="Background">
                <Setter.Value>
                    <SolidColorBrush Color="Gray" Opacity="0.0" />
                </Setter.Value>
            </Setter>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <ContentPresenter Content="{TemplateBinding Content}"/>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <!-- MouseOver Event-->
            <Style.Triggers>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="Opacity"  Value="1.0"/>
                    <Setter Property="Effect">
                        <Setter.Value>
                            <DropShadowEffect ShadowDepth="0" Color="LightBlue" Opacity="1" BlurRadius="20"/>
                        </Setter.Value>
                    </Setter>
                </Trigger>
            </Style.Triggers>
        </Style>

        <Style x:Key="ButtonGlass" TargetType="Button">

            <Setter Property="FontSize" Value="15" />
            <Setter Property="Foreground" Value="WhiteSmoke" />
            <Setter Property="Template">
                <Setter.Value>

                    <ControlTemplate TargetType="Button">
                        <Border x:Name="ButtonBorder" 
                  CornerRadius="25" 
                  BorderThickness="1" 
                  Background="#AA4E4D4D"  
                  BorderBrush="#99FFFFFF"
                  RenderTransformOrigin="0.5,0.5">
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="*"/>
                                    <RowDefinition Height="1.7*"/>
                                </Grid.RowDefinitions>
                                <ContentPresenter x:Name="ButtonContentPresenter"
                                VerticalAlignment="Center"  
                                HorizontalAlignment="Center" 
                                Grid.RowSpan="2" />
                            </Grid>

                        </Border>

                        <ControlTemplate.Triggers>
                            <Trigger Property="IsPressed" Value="True">
                                <Setter Property="RenderTransform" TargetName="ButtonBorder">
                                    <Setter.Value>
                                        <TransformGroup>
                                            <ScaleTransform ScaleX="0.9" ScaleY="0.9"/>
                                        </TransformGroup>
                                    </Setter.Value>
                                </Setter>
                            </Trigger>
                        </ControlTemplate.Triggers>


                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style x:Key="IconButtonStyle" TargetType="{x:Type Button}">
            <Setter Property="BorderThickness" Value="0"/>
            <Setter Property="BorderBrush" Value="Transparent" />
            <Setter Property="Focusable" Value="False"/>
            <Setter Property="Background">
                <Setter.Value>
                    <SolidColorBrush Color="Gray" Opacity="0.0" />
                </Setter.Value>
            </Setter>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <ContentPresenter>
                            <ContentPresenter.Effect>
                                <!-- give the content a bit of shadow -->
                                <DropShadowEffect x:Name="shadow"
                                                    ShadowDepth="2"
                                                    Opacity="0.7"
                                                    BlurRadius="3" />
                            </ContentPresenter.Effect>
                            <ContentPresenter.RenderTransform>
                                <!-- push the content a bit to the left and the top -->
                                <ScaleTransform x:Name="translation" />
                            </ContentPresenter.RenderTransform>
                        </ContentPresenter>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Style.Triggers>
                <Trigger Property="IsPressed" Value="True">
                    <Setter Property="RenderTransform" >
                        <Setter.Value>
                            <TransformGroup>
                                <ScaleTransform ScaleX="0.9" ScaleY="0.9"/>
                            </TransformGroup>
                        </Setter.Value>
                    </Setter>
                </Trigger>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="Effect">
                        <Setter.Value>
                            <DropShadowEffect ShadowDepth="0" Color="White" Opacity="1" BlurRadius="20"/>
                        </Setter.Value>
                    </Setter>
                </Trigger>
            </Style.Triggers>
        </Style>

        <!-- Image Style -->
        <Style x:Key="NextPrevButtonImagStyle" TargetType="{x:Type Image}">
            <Setter Property="Source" Value="Icon/next.png" />
            <Setter Property="Width" Value="50" />
            <Setter Property="Height" Value="50" />
            <Setter Property="Opacity" Value="1.0" />
            <Setter Property="RenderTransformOrigin" Value="0.5,0.5"/>
        </Style>
        <Style x:Key="DeleteStyle" TargetType="{x:Type Image}">
            <Setter Property="Source" Value="Icon/delete-item.png" />
            <Setter Property="Width" Value="40" />
            <Setter Property="Height" Value="40" />
            <Setter Property="Opacity" Value="1.0" />
            <Setter Property="RenderTransformOrigin" Value="0.5,0.5"/>
        </Style>
        <Style x:Key="SaveStyle" TargetType="{x:Type Image}">
            <Setter Property="Source" Value="Icon/save.png" />
            <Setter Property="Width" Value="40" />
            <Setter Property="Height" Value="40" />
            <Setter Property="Opacity" Value="1.0" />
            <Setter Property="RenderTransformOrigin" Value="0.5,0.5"/>
        </Style>
        <Style x:Key="AddStyle" TargetType="{x:Type Image}">
            <Setter Property="Source" Value="Icon/add-item.png" />
            <Setter Property="Width" Value="40" />
            <Setter Property="Height" Value="40" />
            <Setter Property="Opacity" Value="1.0" />
            <Setter Property="RenderTransformOrigin" Value="0.5,0.5"/>
        </Style>
        <Style x:Key="CalendarStyle" TargetType="{x:Type Image}">
            <Setter Property="Source" Value="Icon/Calendar-icon.png" />
            <Setter Property="Width" Value="60" />
            <Setter Property="Height" Value="Auto" />
            <Setter Property="VerticalAlignment" Value="Center" />
            <Setter Property="HorizontalAlignment" Value="Right" />
            <Setter Property="Margin"   Value="0,0,0,0" />
        </Style>
        <Style x:Key="NotiStyle" TargetType="{x:Type Image}">
            <Setter Property="Width" Value="30" />
            <Setter Property="Height" Value="Auto" />
            <Setter Property="VerticalAlignment" Value="Top" />
            <Setter Property="HorizontalAlignment" Value="Right" />
            <Setter Property="Margin"   Value="0,0,-10,0" />
        </Style>

        <!-- TextBlock style -->
        <Style x:Key="textStyle" TargetType="{x:Type TextBlock}">
            <Setter Property="FontFamily" Value="Verdana" />
            <Setter Property="FontSize" Value="15" />
            <Setter Property="Foreground" Value="Gainsboro"></Setter>
            <Setter Property="TextWrapping" Value="Wrap"/>
            <Setter Property="Margin" Value="10,0,10,0" />
        </Style>

        <Style x:Key="headerTextStyle" TargetType="{x:Type TextBlock}">
            <Setter Property="VerticalAlignment" Value="Center"></Setter>
            <Setter Property="FontFamily" Value="Verdana"></Setter>
            <Setter Property="FontWeight" Value="Bold"></Setter>
            <Setter Property="FontSize" Value="24"></Setter>
            <Setter Property="Foreground" Value="GhostWhite"></Setter>
            <Setter Property="TextWrapping" Value="Wrap"/>
            <Setter Property="Margin" Value="10,0,0,0" />
        </Style>


        <!-- ScorllViewer Style-->
        <Style x:Key="ScrollViewerStyle" TargetType="{x:Type ScrollViewer}">
            <Setter Property="HorizontalScrollBarVisibility"  Value="Auto"/>
            <Setter Property="VerticalScrollBarVisibility"  Value="Auto"/>
            <Setter Property="Focusable" Value="False" />
            <Setter Property="VerticalAlignment"  Value="Top"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">

                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>


        <ControlTemplate x:Key="ScrollViewerControlTemplate" TargetType="{x:Type ScrollViewer}">
            <Grid x:Name="Grid" Background="{TemplateBinding Background}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition />
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <Rectangle x:Name="Corner" Grid.Column="1" Fill="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" Grid.Row="1"/>
                <ScrollContentPresenter x:Name="PART_ScrollContentPresenter" CanContentScroll="{TemplateBinding CanContentScroll}" CanHorizontallyScroll="False" CanVerticallyScroll="False" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Grid.RowSpan="2" Margin="{TemplateBinding Padding}" Grid.ColumnSpan="2"/>
                <ScrollBar x:Name="PART_VerticalScrollBar" AutomationProperties.AutomationId="VerticalScrollBar" Cursor="Arrow" Grid.Column="1" Maximum="{TemplateBinding ScrollableHeight}" Minimum="0" Grid.Row="0" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" Value="{Binding VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportHeight}" Width="8"/>
                <ScrollBar x:Name="PART_HorizontalScrollBar" AutomationProperties.AutomationId="HorizontalScrollBar" Cursor="Arrow" Grid.Column="0" Maximum="{TemplateBinding ScrollableWidth}" Minimum="0" Orientation="Horizontal" Grid.Row="1" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" Value="{Binding HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportWidth}" Height="8"/>
            </Grid>
        </ControlTemplate>
        <Style x:Key="ScrollBarPageButton" TargetType="{x:Type RepeatButton}">
            <Setter Property="OverridesDefaultStyle" Value="true"/>
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="Focusable" Value="false"/>
            <Setter Property="IsTabStop" Value="false"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type RepeatButton}">
                        <Rectangle Fill="{TemplateBinding Background}" Height="{TemplateBinding Height}" Width="{TemplateBinding Width}"/>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="HorizontalThumb" TargetType="{x:Type Thumb}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Thumb}">
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="4" />
                                <ColumnDefinition Width="4" />
                                <ColumnDefinition />
                                <ColumnDefinition Width="4" />
                                <ColumnDefinition Width="4" />
                            </Grid.ColumnDefinitions>
                            <Ellipse Grid.Column="0" Grid.ColumnSpan="2" Fill="#FFF4F4F5" />
                            <Rectangle Grid.Column="1" Grid.ColumnSpan="3" Fill="#FFF4F4F5" />
                            <Ellipse Grid.Column="3" Grid.ColumnSpan="2" Fill="#FFF4F4F5" />
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="VerticalThumb" TargetType="{x:Type Thumb}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Thumb}">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="4" />
                                <RowDefinition Height="4" />
                                <RowDefinition />
                                <RowDefinition Height="4" />
                                <RowDefinition Height="4" />
                            </Grid.RowDefinitions>
                            <Ellipse Grid.Row="0" Grid.RowSpan="2" Fill="#FFF4F4F5" />
                            <Rectangle Grid.Row="1" Grid.RowSpan="3" Fill="#FFF4F4F5" />
                            <Ellipse Grid.Row="3" Grid.RowSpan="2" Fill="#FFF4F4F5" />
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style TargetType="{x:Type ScrollBar}">
            <Setter Property="Stylus.IsPressAndHoldEnabled" Value="false"/>
            <Setter Property="Stylus.IsFlicksEnabled" Value="false"/>
            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
            <Setter Property="Width" Value="2"/>
            <Setter Property="MinWidth" Value="2"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type ScrollBar}">
                        <Grid x:Name="Bg" SnapsToDevicePixels="true" Background="#7FBFBFBF">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="0.00001*"/>
                            </Grid.RowDefinitions>
                            <Track x:Name="PART_Track" IsDirectionReversed="true" IsEnabled="{TemplateBinding IsMouseOver}" Grid.Row="1">
                                <Track.DecreaseRepeatButton>
                                    <RepeatButton Command="{x:Static ScrollBar.PageUpCommand}" Style="{StaticResource ScrollBarPageButton}"/>
                                </Track.DecreaseRepeatButton>
                                <Track.IncreaseRepeatButton>
                                    <RepeatButton Command="{x:Static ScrollBar.PageDownCommand}" Style="{StaticResource ScrollBarPageButton}"/>
                                </Track.IncreaseRepeatButton>
                                <Track.Thumb>
                                    <Thumb Style="{DynamicResource VerticalThumb}"  Width="8"/>
                                </Track.Thumb>
                            </Track>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Style.Triggers>
                <Trigger Property="Orientation" Value="Horizontal">
                    <Setter Property="Width" Value="Auto"/>
                    <Setter Property="MinWidth" Value="0"/>
                    <Setter Property="Height" Value="10"/>
                    <Setter Property="MinHeight" Value="10"/>
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="{x:Type ScrollBar}">
                                <Grid x:Name="Bg" SnapsToDevicePixels="true" Background="#00000000">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="0.00001*"/>
                                    </Grid.ColumnDefinitions>
                                    <Track x:Name="PART_Track" Grid.Column="1" IsEnabled="{TemplateBinding IsMouseOver}">
                                        <Track.DecreaseRepeatButton>
                                            <RepeatButton Command="{x:Static ScrollBar.PageLeftCommand}" Style="{StaticResource ScrollBarPageButton}"/>
                                        </Track.DecreaseRepeatButton>
                                        <Track.IncreaseRepeatButton>
                                            <RepeatButton Command="{x:Static ScrollBar.PageRightCommand}" Style="{StaticResource ScrollBarPageButton}"/>
                                        </Track.IncreaseRepeatButton>
                                        <Track.Thumb>
                                            <Thumb  Style="{DynamicResource HorizontalThumb}" Width ="40" Height="5"/>
                                        </Track.Thumb>
                                    </Track>
                                </Grid>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Trigger>
            </Style.Triggers>
        </Style>

    </Application.Resources>
</Application>
